package com.mcmaster.android.data;

import java.io.FileNotFoundException;

public class TourExplorer {
	// Members
	private Tour tour_;
	private int index_;
	
	// Methods
	public TourExplorer() {
		
	}
	
	public void setTour(Tour t) {
		tour_ = t;
		index_ = 0;
	}
	
	public String current() {
		return tour_.get(index_);
	}
	// Precondition: BuildingDatabase.init(,) must have been called
	public Building getCurrentBuilding() throws FileNotFoundException {
		return BuildingDatabase.getBuildingFromQR(tour_.get(index_));
	}
	
	public void next() {
		if (tour_ == null) { return; }
		if (index_ < tour_.size() - 1) { index_++; }
	}
	
	public void prev() {
		if (tour_ == null) { return; }
		if (index_ > 0) { index_--; }
	}
	
	public int getIndex() {
		return index_;
	}
}
